package com.ly.common.commonutils;

import android.os.CountDownTimer;
import android.widget.TextView;

/**
 * Created by luoyang on 2017-6-23.
 */

public class TimeCountUtil extends CountDownTimer  {

    private TextView textView;

    public TimeCountUtil(long millisInFuture, long countDownInterval, TextView textView) {
        super(millisInFuture, countDownInterval);
        this.textView = textView;
    }



    @Override
    public void onTick(long millisUntilFinished) {
        textView.setText(millisUntilFinished/1000 + "秒");
    }

    @Override
    public void onFinish() {
        textView.setEnabled(true);
        textView.setText("重发验证码");
    }
}
